<template>
  <div class="down_template">
    <el-dialog
      title="下载导入模板"
      width="400px"
      :visible.sync="dialogVisible"
      v-dialogDrag
      :close-on-click-modal="false"
      customClass="mes_dialog">
      <div class="mes_btn template_btn">
        <el-button type="primary" @click="downAllWork">
          <i class="iconfont icon-tongyongmoren"></i>
          <span>工单全套模板</span>
        </el-button>
        <el-button type="primary" @click="downWork" plain>
          <i class="iconfont icon-gongdanbiaoge"></i>
          <span>工单表模板</span>
        </el-button>
      </div>
      <div slot="footer" class="mes_btn">
        <el-button @click="dialogVisible = false">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'downTemplate',
  data() {
    return {
      dialogVisible: false, // 是否显示弹框
    }
  },
  methods: {
    // 单表模板下载
    downWork() {
      this.$downByBlob('', '工单表模板.xls', 'a/workorder/workorder/downloadTemplate')
    },
    // 全单表模板下载
    downAllWork() {
      this.$downByBlob('', '工单全套模板.xls', 'a/workorder/workorder/downloadAllTemplate')
    }
  }
}
</script>

<style scoped lang="less">
  .down_template{
    .template_btn{
      justify-content: space-between;
      .el-button{
        width: 170px;
        height: 44px;
        line-height: 44px;
        font-size: 16px;
        .iconfont{
          font-size: 16px;
        }
      }
    }
  }
</style>
